Distributed systems allow multiple clients in a network to access a pool of shared resources. For example, a distributed storage system allows a cluster of host computers (“nodes”) to aggregate local storage devices (e.g., SSD, PCI-based flash storage, SATA, or SAS magnetic disks) located in or attached to each host computer to create a single and shared pool of storage. This pool of storage (sometimes referred to herein as a “datastore” or “store”) is accessible by all host computers in the cluster and may be presented as a single namespace of storage entities (such as a hierarchical file system namespace in the case of files, a flat namespace of unique identifiers in the case of objects, etc.). Storage clients in turn, such as virtual machines spawned on the host computers may use the datastore, for example, to store virtual disks that are accessed by the virtual machines during their operation.
In some cases, data (e.g., associated with a virtual machine's virtual disk) may be migrated from a source host computer to a target host computer in the distributed system. In order to minimize the amount of data transmitted over the network to complete the migration, in some cases, the source host computer sends a number of hash values, associated with data blocks that the source host computer intends to migrate, to one or more target host computers. In response, a target host computer compares the received hash values with hash values stored in its storage and indicates to the source node if it is already storing any of the data blocks that the source node is intending to migrate out based on corresponding hash values stored in its storage matching received hash values. As a result of this, the source host computer is able to transmit only the remaining data blocks (e.g., the data blocks that the target host computer is not already storing) to the target host computer in order to complete the migration. In such cases, however, it is important for the target host computer to be able to prevent the removal of the data blocks that the target host computer reported as already being stored by the target host computer. If the already stored data blocks, and their corresponding hash values, are removed from the target host computer prior to the migration, the target host computer would not have the complete set of data blocks that the source host computer intended to transmit, after the migration.